import React, { useEffect, useState, memo } from 'react'

function List({count}) {
  const [data, setData] = useState([])

  useEffect(() => {
    const data = []
    data.length += 5000
    for (let i = 0; i < data.length; i++) {
      data.fill(i+1, i)
    }
    setData(data)

  }, [count])

  return (
    <div>
      {
        data.map((item) => {
          return (
            <p key={item}>{count}</p>
          )
        })
      }
    </div>
  )
}

export default memo(List);